from typing import List


class Solution:
    def triangularSum(self, nums: List[int]) -> int:
        for n in  range(len(nums)-1,0,-1):
            for i in range(n):
                nums[i]=(nums[i]+nums[i+1])%10
        return nums[0]
